const responese = require("../utils/response")
const jwt = require("../Jwt/jwt")
const middleware = {
    jwt: (req, res, next) => {
        let token = req.headers['authorization']
        if (!token || !jwt.verify(token)) {
            responese.tokenError(res)
            return
        }
        next();
    }
}

module.exports = middleware